package com.haojii.jdo.orm.many2many;

import java.util.Set;

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable(identityType=IdentityType.APPLICATION)
public class User {

	
	public User(String cellphone, String email, String nickName) {
		this.cellphone = cellphone;
		this.email = email;
		this.nickName = nickName;
	}
	@PrimaryKey
	public String email;
	
	@Persistent
	public String cellphone;
	
	@Persistent
	public String nickName;
	
	@Persistent
	private Set<Key> interestedEasytvEntities;
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCellphone() {
		return cellphone;
	}

	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public Set<Key> getInterestedEasytvEntities() {
		return interestedEasytvEntities;
	}

	public void setInterestedEasytvEntities(Set<Key> interestedEasytvEntities) {
		this.interestedEasytvEntities = interestedEasytvEntities;
	}
	
	public Key getKey()
	{
		return KeyFactory.createKey(User.class.getSimpleName(), email);
	}


}
